/*
Lab 03
Class ID        : SE0691
Student ID      : SE90042
Student Name    : Nguyen Cuong
Due Date        : 14 November 2012
I declare that this assignment is my own work
in accordance with FPT Policy.
*/
package edu.fpt.hib;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Admin
 */
public class ConnectionUtil {
    //create connection
    public static Connection openConnection() 
            throws ClassNotFoundException, SQLException{
        Class.forName("com.microsoft.sqlserver.jdbc.SQLServerDriver");
        String connectionUrl = "jdbc:sqlserver://localhost:1433;" +
        "databaseName=myApartment;user=sa;password=123456;";
        Connection con = DriverManager.getConnection(connectionUrl);
        return con;
    }
}
